Package vg.main

Source Code of vg.main.Main

package vg.main;

import javax.swing.SwingUtilities;

import vg.configuration.SimpleConfiguration;
import vg.core.AModel;
import vg.core.VisualGraph;
import vg.core.plugin.PluginParameter;
import vg.logging.SimpleLog;
import vg.logging.WindowMessage;
import vg.model.SQLite4JavaModel;
import vg.modules.backlight.PathSelectingPlugin;
import vg.modules.desktop.DesktopPlugin;
import vg.modules.minimap.MiniMapPlugin;
import vg.modules.notepad.NotepadPlugin;
import vg.modules.opener.GUIOpener;
import vg.modules.projectStorable.StorablePlugin;
import vg.modules.search.SearchPlugin;
import vg.progress.SimpleProgressManager;
import vg.userInterface.SwingUserInterface;
import vg.userInterface.attributePanel.AttributePlugin;
import vg.userInterface.jgraphx.JGraphSettings;
import vg.userInterface.jgraphx.mxLayoutsRegister;
import vg.userInterface.navigator.NavigatorPlugin;
import vg.userInterface.scaling.ZoomPlugin;
import vg.userInterface.tabCloser.SimpleTabCloser;
import vg.userInterface.utilPlugins.GraphLayoutManager;
import vg.userInterface.utilPlugins.LookAndFeelChanger;
import vg.userInterface.utilPlugins.UndoAndRedo;

public class Main {
  public static void main(String[] args) {
    try {
      // set all system services------------
      VisualGraph.setLog(new SimpleLog());
      VisualGraph.setWindowMessage(new WindowMessage());
      VisualGraph.setConfiguration(SimpleConfiguration.getInstance());
      VisualGraph.setProgressManager(new SimpleProgressManager());

      VisualGraph.run();
      SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          try {
            AModel model = new SQLite4JavaModel();// create model
            GraphLayoutManager layoutManager = new GraphLayoutManager();
            SwingUserInterface view = new SwingUserInterface(model, "Welcome to Visual Graph", layoutManager);// create user interface
            // create plugin parameter--------
            PluginParameter param = new PluginParameter(model, view);
            // adding system functions--------
            layoutManager.install(param);
            new SimpleTabCloser(view);
            new DesktopPlugin().install(param);
            new mxLayoutsRegister(view.getGraphLayoutManager());
            new vg.modules.filter.FilterPlugin().install(param);
            new UndoAndRedo().install(param);
            new SearchPlugin().install(param);
            new GUIOpener().install(param);
            new JGraphSettings().install(param);
            new LookAndFeelChanger().install(param);
            new NotepadPlugin().install(param);
            new PathSelectingPlugin().install(param);
            new AttributePlugin().install(param);
            new StorablePlugin().install(param);
            new ZoomPlugin().install(param);
            new MiniMapPlugin().install(param);
            // panels-------------------------
            new NavigatorPlugin().install(param);
          } catch (Throwable ex) {
            VisualGraph.log.printException(ex);
          }
        }
      });
    } catch (Throwable ex) {
      System.err.println(ex.getMessage());
    }
  }
}
TOP

Related Classes of vg.main.Main

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.